---
title: "Emacs Getting Start"
date: 2019-2-1
categories:
- emacs
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org5b7e6a4">Intro</a></li>
<li><a href="#org81560bf">文件</a></li>
<li><a href="#org1ba1cab">光标移动</a></li>
<li><a href="#orgc62cfd2">查找替换</a></li>
<li><a href="#org4003cfb">寄存器</a></li>
<li><a href="#org2101808">宏</a></li>
<li><a href="#orge927b37">FAQ</a>
<ul>
<li><a href="#orgcb5aae2">怎么退出拼符</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-org5b7e6a4">
<h2 id="org5b7e6a4">Intro</h2>
<div class="outline-text-2" id="text-org5b7e6a4">
<blockquote>
<p>
<a href="http://ergoemacs.org/emacs/emacs_kb_shortcuts_pain.html">为什么emacs的快捷键主么变态</a>
</p>
</blockquote>
</div>
</div>
<div class="outline-2" id="outline-container-org81560bf">
<h2 id="org81560bf">文件</h2>
<div class="outline-text-2" id="text-org81560bf">
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">Ctrl+X, Ctrl+F</td>
<td class="org-left">打开文件｜</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, Ctrl+S</td>
<td class="org-left">保存文件</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, Ctrl+W</td>
<td class="org-left">另存为</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, s</td>
<td class="org-left">保存所有</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, Ctrl+V</td>
<td class="org-left">还原更改</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, k</td>
<td class="org-left">关闭 Close Window/Buffer</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, Ctrl+C</td>
<td class="org-left">退出</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="outline-2" id="outline-container-org1ba1cab">
<h2 id="org1ba1cab">光标移动</h2>
<div class="outline-text-2" id="text-org1ba1cab">
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">行首</td>
<td class="org-left">上一个单词</td>
<td class="org-left">上一个字符</td>
<td class="org-left">{% raw %} 光标位置 {% endraw %}</td>
<td class="org-left">下一个字符</td>
<td class="org-left">下一个单词</td>
<td class="org-left">行尾</td>
</tr>
<tr>
<td class="org-left">c-a</td>
<td class="org-left">m-b</td>
<td class="org-left">c-b</td>
<td class="org-left"> </td>
<td class="org-left">c-f</td>
<td class="org-left">m-f</td>
<td class="org-left">c-e</td>
</tr>
</tbody>
</table>
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">文档开始</td>
<td class="org-left">m-&lt;</td>
<td class="org-left">是&lt;符号，所以shift要按住</td>
</tr>
<tr>
<td class="org-left">上一页</td>
<td class="org-left">m-v</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">上一段落</td>
<td class="org-left">m-{</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">上一函数</td>
<td class="org-left">c-m-a</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">上一行</td>
<td class="org-left">c-p</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">{% raw %} 光标 {% endraw %}</td>
<td class="org-left"> </td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">下一行</td>
<td class="org-left">c-n</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">下一函数</td>
<td class="org-left">c-m-e</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">下一段落</td>
<td class="org-left">m-}</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">下一页</td>
<td class="org-left">c-v</td>
<td class="org-left"> </td>
</tr>
<tr>
<td class="org-left">文档结尾</td>
<td class="org-left">m-&gt;</td>
<td class="org-left">&gt;符号，需要按住shift</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="outline-2" id="outline-container-orgc62cfd2">
<h2 id="orgc62cfd2">查找替换</h2>
<div class="outline-text-2" id="text-orgc62cfd2">
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">Command</td>
<td class="org-left">Shortcut</td>
<td class="org-left">Description</td>
</tr>
<tr>
<td class="org-left">Alt+x query-replace</td>
<td class="org-left">Alt+%</td>
<td class="org-left">交互式查找替换，对于激活区域，或光标到结尾的区域</td>
</tr>
<tr>
<td class="org-left">Alt+x query-replace-regexp</td>
<td class="org-left">Ctrl+Alt+%</td>
<td class="org-left">同上，使用正则</td>
</tr>
<tr>
<td class="org-left">Alt+x replace-string</td>
<td class="org-left"> </td>
<td class="org-left">替换文本，从当前位置到结尾，或选中区域</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="outline-2" id="outline-container-org4003cfb">
<h2 id="org4003cfb">寄存器</h2>
<div class="outline-text-2" id="text-org4003cfb">
<p>
ctrl-x r 表示开始操作寄存器。
</p>
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">Ctrl+X r s (#)</td>
<td class="org-left">复制选区到#寄存器，括号内的#是寄存器编号</td>
</tr>
<tr>
<td class="org-left">Ctrl+X r i (#)</td>
<td class="org-left">粘贴#寄存器中的内容</td>
</tr>
<tr>
<td class="org-left">Ctrl+X r space (#)</td>
<td class="org-left">设置书签位置，保存到#寄存器中</td>
</tr>
<tr>
<td class="org-left">Ctrl+X r j /#</td>
<td class="org-left">跳转到#寄存器中保存的位置</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="outline-2" id="outline-container-org2101808">
<h2 id="org2101808">宏</h2>
<div class="outline-text-2" id="text-org2101808">
<table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups">
<colgroup>
<col class="org-left"/>
<col class="org-left"/>
</colgroup>
<tbody>
<tr>
<td class="org-left">Ctrl+X, (</td>
<td class="org-left">开始录制</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, )</td>
<td class="org-left">结束录制</td>
</tr>
<tr>
<td class="org-left">Ctrl+X, e</td>
<td class="org-left">Play！</td>
</tr>
<tr>
<td class="org-left">Ctrl+u (#)</td>
<td class="org-left">括号内的#是数字n，重复操作n次</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="outline-2" id="outline-container-orge927b37">
<h2 id="orge927b37">FAQ</h2>
<div class="outline-text-2" id="text-orge927b37">
</div>
<div class="outline-3" id="outline-container-orgcb5aae2">
<h3 id="orgcb5aae2">怎么退出拼符</h3>
<div class="outline-text-3" id="text-orgcb5aae2">
<p>
状态栏上显示的拼符模式
</p>
<p>
Ctrl+\
</p>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2019-2-1</p>
<p class="author">Author: amo</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
